var express=require("express"),
app=express(),
fs=require("fs")
app.listen("6500",function(){
	console.log("服务器已启动，端口号为6500")
})
//注册
var msgArr=[]
app.post("/zhuce",function(req,res){
	res.header('Access-Control-Allow-Origin','*')
	var param="";
	req.on("data",function(data){
		param+=data
	});
	req.on("end",function(){
		console.log(JSON.parse(param))
		msgArr.push(JSON.parse(param))
		fs.writeFile("msg.json",JSON.stringify(msgArr),"utf-8")
		res.send("注册成功")
	})
})
app.all("*",function(req,res){
	res.header("Access-Control-Allow-Origin","*")
	res.sendFile(__dirname+req.url)
})